#pragma once

#include "Shader.h"

namespace Graphics
{
	class Light;
	class Texture;
}

namespace Graphics
{
class TerrainShader : public Graphics::Shader
{
	RTTI_DECLARATIONS(TerrainShader, Graphics::Shader)
private:
	struct MatrixBufferType
	{
		D3DXMATRIX world;
		D3DXMATRIX view;
		D3DXMATRIX projection;
	};

	struct LightBufferType
	{
		D3DXVECTOR4 ambientColor;
		D3DXVECTOR4 diffuseColor;
		D3DXVECTOR3 lightDirection;
		float padding;
	};

public:
	TerrainShader(void);
	virtual ~TerrainShader(void);
	virtual bool Initialize();
	virtual void Deinitialize();
	virtual bool Render(int indexCount, D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix,  D3DXMATRIX projectionMatrix, Light* light, Texture* texture);

protected:
	bool InitializeShader(HWND winHandle, const char* vertexShaderName, const char*  pixelShaderName);
	void DeinitializeShader();
	bool SetShaderParameters(D3DXMATRIX worldMatrix, D3DXMATRIX viewMatrix, D3DXMATRIX projectionMatrix, Light* light, Texture* texture);

protected:
	ID3D11Buffer* mLightBuffer;
};
}